<template>
    <a-form-item :label="label" :name="formkey" :label-col="labelCol">
        <div class="FormView">
            <a-input :name="formkey" v-model:value="Value" spellcheck="false" :disabled="disabled" />
            <a-button :type="Code ? 'primary' : 'default'" class="button" v-if="codeStatus">
                <template #icon>
                    <span class="C-Icon">&#xe6d5;</span>
                </template>
            </a-button>
        </div>
    </a-form-item>
</template>
<script setup>
import { computed, ref } from 'vue';
const props = defineProps(['label', 'code', 'disabled', 'codeStatus', 'labelWidth', 'formkey']);
const Value = defineModel('value');
const labelCol = computed(() => {
    if (props.labelWidth) {
        return { style: { width: props.labelWidth } }
    } else {
        return null
    }
});
</script>
<style scoped lang="less"></style>